Sublinear Parallel Algorithm for Computing the Greatest Common Divisor of Two Integers
نویسندگان
چکیده
The atdvent of practical parallel processors has caused a reexamination of many existing algorithms with'the hope of discovering a parallel implementation. One of the oldest and best know algorithms is Euclid's algorithm for computing the greatest common divisor (GCD). In this paper we present a parallel algorithm to compute the GCD of two integers. Although there have been results in the parallel computation of the GCD 9f polynomials (Borodin, von zur Gathen, and Hopcroft (1983)), the integer case still appeared to be inherently serial. To our knowledge, the best result to date for computing the GCD of two integers is by Brent and Kung (1983), who achieve a running time of O(n) with n processors arranged in a systolic array, where n is the number of bits required to represent the larger of the two inpnt numbers. Although their method is an improvement on the best know serial integer GCD algorithm O(n log2 n log log n) by Schonhage (1971), it still requires n iterations; the parallelism only reduces the bit operations per iteration. In this paper we present a subline? time parallel algorithm to compute the integer GCD of two numbers on a weak CRCW model of parallel computation allowb g concurrent reads but only concurrent writes of the same value. The time bound is O(n log log n/ log n) assume there are n210g2n processors working in parallel. This is computed assuming unit time for each elementary hit operation. There is a nice duality &eorem that we mention in passing. Note that the GCD(a,b) equals both (i) the mhximum d such that d divides a and b, and (ii) the minimum d > 0 expressible as pa + qb, where p and q are integers. Both these properties can be demonstrated in O(1ogn) parallel time. Thus, if the language L = ('(k,a, b) I the kth binary digit of GCD(a,b) equals 1 } were complete for polynomial time with respect to logn parallel time reductions, then all problems in P would have a logn parallel time duality theorem. Given this fact, we conjecture that the GCD problem is not complete for P. An Overview of the Algori thm
منابع مشابه
A Sublinear Time Parallel GCD Algorithm for the EREW PRAM
We present a parallel algorithm that computes the greatest common divisor of two integers of n bits in length that takes O(n log logn/ logn) expected time using n processors on the EREW PRAM parallel model of computation. We believe this to be the first sublinear time algorithm on the EREW PRAM for this problem.
متن کاملApproximate Polynomial GCD over Integers with Digits-wise Lattice
For the given coprime polynomials over integers, we change their coefficients slightly over integers so that they have a greatest common divisor (GCD) over integers. That is an approximate polynomial GCD over integers. There are only two algorithms known for this problem. One is based on an algorithm for approximate integer GCDs. The other is based on the well-known subresultant mapping and the...
متن کاملOn the Frobenius Number of a Modular Diophantine Inequality
We present an algorithm for computing the greatest integer that is not a solution of the modular Diophantine inequality ax mod b 6 x, with complexity similar to the complexity of the Euclid algorithm for computing the greatest common divisor of two integers.
متن کاملMultidimensional Greatest Common Divisor and Lehmer Algorithms
A class of multidimensional greatest common divisor algorithms is studied. Their connection with the Jacobi algorithm is established and used to obtain theoretical properties such as the existence of digit frequencies. A technique of D. H. Lehmer's for Euclid's algorithm is generalized for efficient computation of the multidimensional algorithms. For triples of integers, two algorithms of inter...
متن کاملGreatest common divisor
In mathematics, the greatest common divisor (gcd), also known as the greatest common factor (gcf), highest common factor (hcf), or greatest commonmeasure (gcm), of two or more integers (when at least one of them is not zero), is the largest positive integer that divides the numbers without a remainder. For example, the GCD of 8 and 12 is 4.[1][2] This notion can be extended to polynomials, see ...
متن کامل